# 设置项目路径（请改成你自己的目录）
Set-Location "C:\Users\Dell\Desktop\多空交易"

Write-Host ">>> Exporting dependencies to requirements.txt ..."
pip freeze > requirements.txt

# 询问 commit message
$commitMsg = Read-Host "Enter commit message (default: update)"
if ([string]::IsNullOrWhiteSpace($commitMsg)) {
    $commitMsg = "update"
}

# 添加文件并提交
git add .
git commit -m "$commitMsg"

# 确保远程仓库地址正确（这里改成你的仓库地址）
git remote set-url origin https://<你的token>@gitee.com/wxm2401203246/spot_trading_-wangxinmiao.git

# 拉取远程，避免冲突
git pull origin master --allow-unrelated-histories

# 推送到远程
git push origin master

Write-Host ">>> Push complete!"
